POV-Ray : Newsgroups : povray.general : Camera look_at question : Re: Camera look_at question Server Time
3 Aug 2024 20:17:31 EDT (-0400)
  Re: Camera look_at question  
From: Philippe Debar
Date: 22 Jan 2004 17:15:32
Message: <40104b84@news.povray.org>
What is the problem ? Understanding shearing, the matrix or how to set 
up the camera ? If you know how you need to set up your camera vectors, 
you can do this directly and need not to use matrix.

Here is an example of a camera that automatically eliminates the 
vertical vanishing point :


camera{
   // Desc: Camera that eliminates vertical vanishing point
   // Date: 25 juillet 2002
   // Auth: Philippe Debar phd### [at] yahoofr

   #local Camera_Location = <-3,.01,-3>;
   /* as the standard "location" */

   #local Camera_Up       =  1 ;
   /* almost as the standard "up" : use a number (scalar) instead of a 
vector */

   #local Camera_Right    =  image_width/image_height ;
   /* almost as the standard "right" : use a number (scalar) instead of 
a vector  */

   #local Camera_Zoom     =  1 ;
   /*  almost as the standard "direction" : use a number (scalar) 
instead of a vector  */

   #local Camera_Look_At  = <-.5,2,.5> ;
   /* as the standard "look_at" */



   #ifndef(Shear_Trans) #include "transforms.inc" #end
   location 0
   up Camera_Up*y
   right Camera_Right*x
   direction
     vnormalize(
 
(Camera_Look_At.y-Camera_Location.y)/vlength((Camera_Look_At-Camera_Location)*<1,0,1>)*y
       + z
       )
     * Camera_Zoom
   Reorient_Trans(z, (Camera_Look_At-Camera_Location)*<1,0,1>)
   translate Camera_Location
}


You need to disable vista buffers to use this (option -uv).

I'll gladly explain anything that seems to be obscure.


Povingly,

Philippe


Tom Melly wrote:
> "Rune" <run### [at] runevisioncom> wrote in message
> news:400fee90$1@news.povray.org...
> 
>>Philippe Debar wrote:
>>
>>>You could check POV-Ray 3.5/scenes/camera/shear.pov
>>
>>Ah yes, I was going to point out applying a matrix to the camera. Didn't
>>know there was a sample scene for it though. That's neat. :)
>>
> 
> 
> Gimme about 6 million years and I might understand how that works... IMHO Neo
> had it easy.
> 
>


Post a reply to this message

Copyright 2003-2023 Persistence of Vision Raytracer Pty. Ltd.